<?php


namespace App\Models\TwoLevelMainte;

use App\Models\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;

class TwoLevelMainte extends Model
{
    protected $table = 'akbus_two_level_mainte';

    protected $fillable = [
        'type',
        'date',
        'created_at',
        'updated_at',
    ];

    /**
     * 不可批量赋值的属性。
     *
     * @var array
     */
    protected $guarded = [
    ];

    /**
     * 类型转化
     *
     * @var array
     */
    protected $casts = [
    ];

    /**
     * 隐藏的字段
     *
     * @var array
     */
    protected $hidden = [
    ];

    /**
     * 文件
     */
    public function qualificationFile()
    {
        return $this->hasmany(TwoLevelMainteFile::class, 'two_mainte_id');
    }

    /**
     * 关联节点
     *
     * @return HasMany
     */
    public function bus(): HasMany
    {
        return $this->hasmany(TwoLevelMainteBus::class, 'two_mainte_id');
    }
}
